package com.blrs.service.project.self.impl;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

import com.blrs.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.blrs.mapper.SelfProjectRecordMapper;
import com.blrs.domain.SelfProjectRecord;
import com.blrs.service.project.self.ISelfProjectRecordService;

/**
 * 自建项目履历Service业务层处理
 * 
 * @author wangchao
 * @date 2024-06-20
 */
@Service
public class SelfProjectRecordServiceImpl implements ISelfProjectRecordService 
{
    @Autowired
    private SelfProjectRecordMapper selfProjectRecordMapper;

    /**
     * 查询自建项目履历
     * 
     * @param id 自建项目履历主键
     * @return 自建项目履历
     */
    @Override
    public SelfProjectRecord selectSelfProjectRecordById(String id)
    {
        return selfProjectRecordMapper.selectSelfProjectRecordById(id);
    }

    /**
     * 查询自建项目履历列表
     * 
     * @param selfProjectRecord 自建项目履历
     * @return 自建项目履历
     */
    @Override
    public List<SelfProjectRecord> selectSelfProjectRecordList(SelfProjectRecord selfProjectRecord)
    {
        return selfProjectRecordMapper.selectSelfProjectRecordList(selfProjectRecord);
    }

    /**
     * 新增自建项目履历
     * 
     * @param selfProjectRecord 自建项目履历
     * @return 结果
     */
    @Override
    public int insertSelfProjectRecord(SelfProjectRecord selfProjectRecord)
    {

        selfProjectRecord.setCreateId(SecurityUtils.getUserId());
        selfProjectRecord.setCreationTime(new Timestamp(new Date().getTime()));
        return selfProjectRecordMapper.insertSelfProjectRecord(selfProjectRecord);
    }

    /**
     * 修改自建项目履历
     * 
     * @param selfProjectRecord 自建项目履历
     * @return 结果
     */
    @Override
    public int updateSelfProjectRecord(SelfProjectRecord selfProjectRecord)
    {
        return selfProjectRecordMapper.updateSelfProjectRecord(selfProjectRecord);
    }

    /**
     * 批量删除自建项目履历
     * 
     * @param ids 需要删除的自建项目履历主键
     * @return 结果
     */
    @Override
    public int deleteSelfProjectRecordByIds(String[] ids)
    {
        return selfProjectRecordMapper.deleteSelfProjectRecordByIds(ids);
    }

    /**
     * 删除自建项目履历信息
     * 
     * @param id 自建项目履历主键
     * @return 结果
     */
    @Override
    public int deleteSelfProjectRecordById(String id)
    {
        return selfProjectRecordMapper.deleteSelfProjectRecordById(id);
    }
}
